#include <boost/regex.hpp>
#include <string>
#include <iostream>
using namespace std;
using namespace boost;
void func1() {
    string s = "123eqA_ Libraries";
    boost::regex expr{"\\w+\\s\\w+"};
    cout << regex_match(s, expr) << '\n';
}
void func2() {
    std::string s = "Boost Libraries";
    boost::regex expr{"(\\w+)\\s(\\w+)"};
    boost::smatch what;
    if (boost::regex_search(s, what, expr))
    {
    std::cout << what[0] << '\n';
    std::cout << what[1] << "_" << what[2] << '\n';
    }
}
void func3() {
    std::string s = " Boost Libraries ";
    boost::regex expr{"\\s"};
    std::string fmt{"_"};
    std::cout << boost::regex_replace(s, expr, fmt) << '\n';
}
int main() {
  func3();
}